#define _CRT_SECURE_NO_WARNINGS

#include "sort.h"

void Print(int* arr, int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}
//
//int main()
//{
//	int arr[] = { 5, 3, 43,123,64,1,1,1,5,5,5,4,4,4,4555,5555,555 };
//	int n = sizeof(arr) / sizeof(arr[0]);
//	Print(arr, n);
//
//	//MergeSort(arr, n);
//	CountSort(arr, n);
//	Print(arr, n);
//	return 0;
//}

void TestOP()
{
    srand((unsigned int)time(NULL));
    const int N = 100000;
    int* a1 = (int*)malloc(sizeof(int) * N);
    int* a2 = (int*)malloc(sizeof(int) * N);

    for (int i = 0; i < N; ++i)
    {
        a1[i] = rand();
        a2[i] = a1[i];
    }
     int begin1 = clock();
     MergeSort(a1, N);
     int end1 = clock();

     int begin2 = clock();
     CountSort(a2, N);
     int end2 = clock();

    printf("MergeSort:%d\n", end1 - begin1);
    printf("CountSort:%d\n", end2 - begin2);

    free(a1);
    free(a2);
}


int main()
{
    TestOP();
	return 0;
}